#include "my_head.h"

bool UserModify(p_user_node head)
{
    char name[20];
    if(head==NULL)
    {
        printf("error\n");
        return false;
    }
    p_user_node p=head->next;
    printf("请输入你想要修改的用户信息的用户名:");
    scanf("%s",name);
    while(p!=NULL&&strcmp(name,p->data.user_name)!=0)
    {
        p=p->next;
    }
    if(p!=NULL)
    {
        printf("请修改该用户角色:\n");
        scanf("%s",p->data.user_role);
        printf("请修改该用户用户名:\n");
        scanf("%s",p->data.user_name);
        printf("请修改该用户账号:\n");
        scanf("%d",&(p->data.user_account.id));
        printf("请修改该用户密码:\n");
        scanf("%s",p->data.user_account.password);  
        printf("请修改该用户权限:\n");
        scanf("%d",&(p->data.user_account.permission));
        printf("该用户信息修改成功！\n");
        printf("=============\n");
        return true;
    }else
    {
        printf("未找到该用户信息！\n");
        printf("=============\n");
        return false;
    }
}